﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace wp7CattoFreeAppv2
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;

            ////////////////////////////////////////
            // App Bar Dev coments below

            //ApplicationBar = new ApplicationBar();
            //ApplicationBar.IsMenuEnabled = true;
            //ApplicationBar.IsVisible = true;
            //ApplicationBar.Opacity = 1.0;


            //ApplicationBarIconButton hide = new ApplicationBarIconButton(new Uri("/Images/expand.png", UriKind.Relative));
            //hide.Text = "hide";
            //hide.Click += new EventHandler(hide_Click);

            //ApplicationBarIconButton opacity = new ApplicationBarIconButton(new Uri("/Images/opacity.png", UriKind.Relative));
            //opacity.Text = "opacity";
            //opacity.Click += new EventHandler(opacity_Click);

            //ApplicationBarIconButton enabled = new ApplicationBarIconButton(new Uri("/Images/menuenabled.png", UriKind.Relative));
            //enabled.Text = "enabled";
            //enabled.Click += new EventHandler(enabled_Click);

            //ApplicationBar.Buttons.Add(hide);
            //ApplicationBar.Buttons.Add(opacity);
            //ApplicationBar.Buttons.Add(enabled);

            //ApplicationBarMenuItem foregroundItem = new ApplicationBarMenuItem("use foreground color");
            //foregroundItem.Click += new EventHandler(foregroundItem_Click);

            //ApplicationBarMenuItem accentItem = new ApplicationBarMenuItem("use accent color");
            //accentItem.Click += new EventHandler(accentItem_Click);

            //ApplicationBar.MenuItems.Add(foregroundItem);
            //ApplicationBar.MenuItems.Add(accentItem);






            ///////////////////////////////////

//            this.BackKeyPress += new
//EventHandler<System.ComponentModel.CancelEventArgs>(MainPage_BackKeyPress);

        }

        #region "Events"
        /// <summary> event _BackKEyPress  -- Back Key Pressed Event
        /// Back Key Pressed Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void MainPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
        {
            //NavigationService.Navigate(new Uri("/CattoMainMenu.xaml", UriKind.Relative));
            e.Cancel = true;
        }

        /// <summary> btn to navigate to Main Menu
        /// btn to navigate to Main Menu
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMainMenu_Click(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/CattoMainMenu.xaml", UriKind.Relative));
            //e.Cancel = true;
        }

        #endregion



    }
}
